//获取应用实例
Page({ 
    data:{
        temp:"",
        temperature:"",
        type:"",
        city:"",
        date:"",
        direction:"",
        condition:'10',
        futureArray:'[]',
    },
    onLoad:function(){
        var that = this;
        var result = null;
        wx.request({
            url: "http://apis.juhe.cn/simpleWeather/query?",
            data: {
                "city": "成都",
              "key": "8e154a94cf655557a61628ac8296b1e3"
            },
            success(res) {
                result = res.data.result;
                var test1 = JSON.stringify(result);
                console.log(test1);
                that.setData({
                    city: res.data.result.city,
                    temp: res.data.result.realtime.temperature,
                    temperature: res.data.result.future[0].temperature,
                    type: res.data.result.future[0].weather,
                    direction: res.data.result.future[0].direct,
                    date: res.data.result.future[0].date,
                    futureArray: res.data.result.future,
                })
            },
        })
    },

})
